// const $api = require('../../utils/api.js').API;

Page({
    data: {
        umbrellaList: [
            {
                id: 1,
                name: 'Lifeme 梨木伞',
                desc: '优质花梨木伞柄，指尖上的原木质感',
                pic: 'https://openfile.meizu.com/group1/M00/07/63/Cgbj0V1l2T6AK4g2AAV30_p6ODA499.png680x680.jpg',
                code: 'A001',  // 雨伞编号
                comment: 12, // 使用评论数
                useNum: 15, // 借伞次数
                status: 0, // 雨伞状态：0可预约 1预约中、2已借出
                reserve: 0, // 是否借伞&预约：0否 1是
            },
            {
                id: 2,
                name: 'Lifeme 梨木伞',
                desc: '优质花梨木伞柄，指尖上的原木质感',
                pic: 'https://openfile.meizu.com/group1/M00/07/63/Cgbj0V1l2T6AK4g2AAV30_p6ODA499.png680x680.jpg',
                code: 'A002',
                comment: 8,
                useNum: 13,
                status: 1,
                reserve: 0,
            },
            {
                id: 3,
                name: 'Lifeme 梨木伞',
                desc: '优质花梨木伞柄，指尖上的原木质感',
                pic: 'https://openfile.meizu.com/group1/M00/07/63/Cgbj0V1l2T6AK4g2AAV30_p6ODA499.png680x680.jpg',
                code: 'A003',
                comment: 45,
                useNum: 18,
                status: 1,
                reserve: 1,
            },
            {
                id: 4,
                name: 'Lifeme 梨木伞',
                desc: '优质花梨木伞柄，指尖上的原木质感',
                pic: 'https://openfile.meizu.com/group1/M00/07/63/Cgbj0V1l2T6AK4g2AAV30_p6ODA499.png680x680.jpg',
                code: 'A003',
                comment: 45,
                useNum: 18,
                status: 2,
                reserve: 0,
            },
            {
                id: 5,
                name: 'Lifeme 梨木伞',
                desc: '优质花梨木伞柄，指尖上的原木质感',
                pic: 'https://openfile.meizu.com/group1/M00/07/63/Cgbj0V1l2T6AK4g2AAV30_p6ODA499.png680x680.jpg',
                code: 'A003',
                comment: 45,
                useNum: 18,
                status: 2,
                reserve: 1,
            }
        ],
    },
    onLoad: function (options) {
        // $api.getBubble()
        //     .then(res => {
        //         //请求成功
        //         console.log(res)
        //     })
        //     .catch(err => {
        //         //请求失败
        //     })
    },
    toUmbrella(e) {
        let item = e.currentTarget.dataset;
        wx.navigateTo({
            url: '/pages/umbrella/index?id=' + item.id
        });
    }
})